/**
 * Created by Administrator on 2017/3/13 0013.
 */




Page8=function() {
        var whole = new PIXI.DisplayObjectContainer();
        var delayTime=5;

        var white=new PIXI.Graphics();
        white.beginFill(0xffffff,1);
        white.drawRect(0,0,1136,740);
        whole.addChild(white);

        var pic1=new PIXI.Sprite(resource["assets/images/p8_2.png"].texture);
        var pic2=new PIXI.Sprite(resource["assets/images/p8_1.png"].texture);
        var pic3=new PIXI.Sprite(resource["assets/images/p8_4.png"].texture);
        var pic4=new PIXI.Sprite(resource["assets/images/p8_3.png"].texture);
        var pic5=new PIXI.Sprite(resource["assets/images/p8_6.png"].texture);
        var pic6=new PIXI.Sprite(resource["assets/images/p8_5.png"].texture);
        var pic6Mask=new PIXI.Graphics();
        pic6Mask.beginFill(0x000000,1);
        pic6Mask.drawRect(0,0,1300,600);
        pic6.mask=pic6Mask;

        whole.addChild(pic1);
        whole.addChild(pic2);
        whole.addChild(pic3);
        whole.addChild(pic4);
        whole.addChild(pic5);
        whole.addChild(pic6);
        whole.addChild(pic6Mask);

        pic1.alpha=1;
        pic2.alpha=1;
        pic3.alpha=0;
        pic4.alpha=0;
        pic5.alpha=0;
        pic6.alpha=1;

        pic1.x=0;pic1.y=-50;
        pic2.x=224;pic2.y=92;

        pic3.x=0;pic3.y=-50;
        pic4.x=190;pic4.y=92;

        pic5.x=0;pic5.y=-50;
        pic6.x=-46;pic6.y=-80;




        pic2.tint=0xf8207c;
        pic4.tint=0xffa45b;

        pic2.blendMode=PIXI.BLEND_MODES.MULTIPLY;





        pic6Mask.x=-1300;

        var inter1;
        var inter2;
    whole.In=function(){

            inter1= setInterval(function(){
                    if(pic2.blendMode==PIXI.BLEND_MODES.MULTIPLY){
                            pic2.blendMode=PIXI.BLEND_MODES.ADD;
                    }
                    else{
                            pic2.blendMode=PIXI.BLEND_MODES.MULTIPLY;
                    }
            },100)

            inter2=setInterval(function(){
                    if(pic4.blendMode==PIXI.BLEND_MODES.MULTIPLY){
                            pic4.blendMode=PIXI.BLEND_MODES.ADD;
                            pic4.tint=0xff7c14;
                    }
                    else{
                            pic4.blendMode=PIXI.BLEND_MODES.MULTIPLY;
                            pic4.tint=0xffa45b;
                    }
            },100)

            TweenMax.to(pic3,1,{delay:1,alpha:1})
            TweenMax.to(pic4,1,{delay:1.3,alpha:1})
            TweenMax.to(pic5,1,{delay:2.6,alpha:1})
            TweenMax.to(pic6Mask,1,{delay:3.2,x:0,ease:Cubic.easeOut});

    }
    whole.Out=function(){
            clearInterval(inter1);
            clearInterval(inter2);
            TweenMax.killAll();
             setTimeout(function () {
                     pic3.alpha=0;
                     pic4.alpha=0;
                     pic5.alpha=0;
                     pic6Mask.x=-1300;
             },200)

        }


        return whole;
    }


